<?php

namespace Common\Service;


/** 
 * 虚拟激活码
 * @author Legend. <xcx_legender@qq.com>
 * @param 
 * @return 
 */
Class CodesService extends BaseService
{

	/**
	 
	 index
	 id, key, 	object_type(index), object_id(index),status(index) uid (index), bindtime
	  1   usd-3dd-a   'gift'   		1    				0  			0      null
	  2   ss-ee-s     'gift'   		1    				1  			5     1422034343


	 */
	protected $_validate = array(
		array('key', 'require', 'code码必须', self::MUST_VALIDATE , 'regex', self::MODEL_BOTH),
        array('key', '', 'code码已经存在', self::MUST_VALIDATE, 'unique', self::MODEL_BOTH),
	);

	protected $_auto = array(
        array('status', 0, self::MODEL_INSERT),
        array('uid', 0, self::MODEL_INSERT),
    );

}